package org.summer.lawyer.constant.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 *
 */
@Getter
@AllArgsConstructor
public enum PayRefundStatus {

    /**
     * 等待退款
     */
    PENDING(0, "等待退款"),

    /**
     * 退款成功
     */
    SUCCESS(1, "退款成功"),

    FAILURE(2, "退款失败");

    public static PayRefundStatus getByCode(Integer code) {
        return ArrayUtil.firstMatch(item -> Objects.equals(item.getCode(), code), values());
    }

    private final Integer code;
    private final String  info;
}
